package org.jeecg.modules.wmhb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.wmhb.entity.WmProductRecpt;
import org.jeecg.modules.wmhb.entity.WmTaskBom;
import org.jeecg.modules.wmhb.mapper.WmProductRecptMapper;
import org.jeecg.modules.wmhb.service.IWmProductRecptService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 任务报工入库记录表
 * @Author: jeecg-boot
 * @Date:   2024-08-31
 * @Version: V1.0
 */
@Service
public class WmProductRecptServiceImpl extends ServiceImpl<WmProductRecptMapper, WmProductRecpt> implements IWmProductRecptService {
    @Override
    public List<WmProductRecpt> queryListByWmTaskId(String wmTaskId){
        LambdaQueryWrapper<WmProductRecpt> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WmProductRecpt::getWmTaskId, wmTaskId);
        List<WmProductRecpt> wmProductRecptList = list(queryWrapper);
        return wmProductRecptList;
    };

    @Override
    public WmProductRecpt getOneByWmTaskId(String wmTaskId){
        LambdaQueryWrapper<WmProductRecpt> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WmProductRecpt::getWmTaskId, wmTaskId).last("LIMIT 1");
        WmProductRecpt wmProductRecpt = getOne(queryWrapper);
        return wmProductRecpt;
    };
}
